package com.zmj.sy.mom.srv.aps.controller;

import com.zmj.sy.mom.srv.aps.bean.vo.logNestExce.LogNestExceReqVo;
import com.zmj.sy.mom.srv.aps.bean.vo.logNestExce.LogNestExceResVo;
import com.zmj.sy.mom.srv.aps.bean.vo.logNestExce.PickPlateInfoResVo;
import com.zmj.sy.mom.srv.aps.bean.vo.base.BaseIdReqVo;
import com.zmj.sy.mom.srv.aps.bean.vo.base.BaseListResVo;
import com.zmj.sy.mom.srv.aps.bean.vo.base.BasePageResVo;
import com.zmj.sy.mom.srv.aps.bean.vo.base.BaseResVo;
import com.zmj.sy.mom.srv.aps.bean.vo.nest.NestPlatePushDto;
import com.zmj.sy.mom.srv.aps.service.LogNestExceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequiredArgsConstructor
@Api(tags = "套料异常零件信息汇总")
@RestController
@RequestMapping("/logNestExce")
public class LogNestExceController {

    private final LogNestExceService logNestExceService;

    @ApiOperation("异常零件查询（分页）")
    @GetMapping("/getExcePart")
    public BasePageResVo<LogNestExceResVo> getExcePart(LogNestExceReqVo reqVo) {
        return logNestExceService.getExcePart(reqVo);
    }

    @ApiOperation("查看领料单下的钢板信息")
    @GetMapping("/getPlateInfo")
    public BaseListResVo<PickPlateInfoResVo> getPlateInfo(BaseIdReqVo reqVo) {
        return logNestExceService.getPlateInfo(reqVo);
    }

    @ApiOperation("异常钢板处理（调用aps-mes接口）")
    @GetMapping("/excePlateIn")
    public BaseResVo excePlateIn(NestPlatePushDto reqVo) {
        logNestExceService.excePlateIn(reqVo);
        return BaseResVo.ok();
    }

}
